<template>
	<div class="q-error-title">
		<span class="q-style-type">【完形填空题】</span>
		<ve-parse class="q-style-text" :article="parseTitle" />
	</div>
</template>

<script>
	/**
	 * @description 完形填空题组件
	 */
	export default {
		props: {
			// 题干
			questionTitle: {
				type: String,
				default: ""
			}
		},
		computed: {
			parseTitle() {
				let index = 0;
				return this.questionTitle.replace(/（\s*\)|\(\s*）|\(\s*\)|（\s*）/g, () => {
					index += 1;
					return `<span style="display:inline-block;padding: 0 20px;margin: 0 5px;border-bottom: 1px solid #000;">${index}</span>`;
				});
			}
		}
	};
</script>
